package com.vehicle.threadLocal;

import com.vehicle.domains.info.UserInfo;

public class UserContextThreadLocal {

    private final static ThreadLocal<UserInfo> userInfoThreadLocal = new ThreadLocal<>();

    public static UserInfo getUserInfo() {
        return userInfoThreadLocal.get();
    }

    public static void setUserInfo(UserInfo userInfo) {
        userInfoThreadLocal.set(userInfo);
    }

    public static void remove() {
        userInfoThreadLocal.remove();
    }
}
